// test.ts

import { IncomingMessage, ServerResponse } from 'http'
import { MockMethod } from 'vite-plugin-mock'
export default [
  {
    url: '/api/trade/Order/pay',
    method: 'post',
    response: ({ query }) => {
      // 微信：payCode=804000&isUseBalance=0&orderNum=230130183354100190316267

      return {
        sign: 1,
        msg: 'https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx30183643329603d6cfd16d78a23c1d0000&package=3194973661',
      }
    },
  },
  {
    url: '/api/trade/Order/pay2',
    method: 'post',
    timeout: 2000,
    response: {
      sign: 1,
      msg: 'https://openapi.alipay.com/gateway.do?alipay_sdk=alipay-easysdk-java&app_id=2021003112643762&biz_content=%7B%22body%22%3A%22%E5%88%9D%E4%B8%80%E8%AF%AD%E6%96%87%E5%9F%B9%E8%AE%AD%E7%8F%AD%EF%BC%88%E6%98%A5%E4%B8%8A%C2%B7%E5%85%A8%E5%9B%BD%E7%89%88%C2%B7A%2B%EF%BC%89%22%2C%22out_trade_no%22%3A%22PAY202301301837447039377824%22%2C%22product_code%22%3A%22WAP%22%2C%22subject%22%3A%22%E5%95%86%E5%93%81-230130183354100190316267%22%2C%22time_expire%22%3A%222023-01-30+18%3A48%3A44%22%2C%22timeout_express%22%3A%2211m%22%2C%22total_amount%22%3A%22528.00%22%7D&charset=UTF-8&format=json&method=alipay.trade.wap.pay&notify_url=https%3A%2F%2Ftrade.100tal.com%2Fnotify%2Fali%2Fpay&return_url=https%3A%2F%2Fwww.xiwang.com%2Fapi%2Fmall%2Fcart%2Fcomplete%3ForderNum%3D230130183354100190316267&sign=PX3PIwijwz9L%2F2%2BLJKKuq5s5FGpAtp6Hl7%2FFJNh%2BF4qMbMkSy6Ikd3Oe%2Bq7NFyuFVMZVZliTajLTVy29PJI%2FuVag7kPAWgN4B0ihmoXYrUWDr4ZCz9oQ%2BXaeZCXThH6uTfpqcjNoTpJ3X9yPo5jQMAVmea9qKm67OTYd2QJ%2BMQUkGvgnA0e13PGLKYSeNqHHqTNFee%2FnnAj%2BHxQ8RrfGgrZuXZOpK4D3JzMW3A5aW3%2FvjEXl2ThWVGzTFME6PXCFEZwO%2Fgx%2BrN%2BdX8Vl1evZsRNyD31yzUhOQjWWV%2Fd9KuN3QzF%2Fhaa8dUYJXVFSlOwV5g4g9YK0QJ2%2FiRhjFE81Lw%3D%3D&sign_type=RSA2&timestamp=2023-01-30+18%3A37%3A44&version=1.0',
    },
  },
  {
    url: '/api/trade/Order/add',
    method: 'get',
    rawResponse: (req: IncomingMessage, res: ServerResponse) => {
      res.end(
        "<script> window.location.href='/#/payStatus?X-Businessline-Id=30&orderNum=230130183106100186896267'; </script>",
      )
      // 微信：payCode=804000&isUseBalance=0&orderNum=230130183354100190316267
    },
  },
  {
    url: '/api/trade/order/getOrderPayStatus',
    method: 'post',
    response: ({ query }) => {
      // 微信：payCode=804000&isUseBalance=0&orderNum=230130183354100190316267

      return false
    },
  },
] as MockMethod[]
